Skip to content

fix(frontend): add credentials: 'include' to auth cookie fetches - #321

Open
thrawn-sh wants to merge 1 commit into
chriswritescode-dev:mainfrom
thrawn-sh:fix/missing-fetch-credentials
Open

fix(frontend): add credentials: 'include' to auth cookie fetches#321
thrawn-sh wants to merge 1 commit into
chriswritescode-dev:mainfrom
thrawn-sh:fix/missing-fetch-credentials

Conversation

@thrawn-sh

@thrawn-sh thrawn-sh commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Ensure auth cookies are sent on cross-origin API requests that were missing credentials: 'include', including auth-info config, file browser, TTS/STT, and the opencode event stream transport.

Summary

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation

Checklist

  • Code follows project style (no comments, named imports)
  • TypeScript types are properly defined
  • Tests added/updated (80% coverage target)
  • pnpm lint passes locally
  • pnpm typecheck passes locally

Summary by CodeRabbit

  • Bug Fixes
    • Improved authentication and session handling across transcription, text-to-speech, file browsing, file editing, configuration loading, and event-stream requests.
    • Browser credentials are now included with relevant requests, helping authenticated actions work consistently.
  • Tests
    • Updated request validation to confirm credentials are included with transcription requests.

Ensure auth cookies are sent on cross-origin API requests that were
missing credentials: 'include', including auth-info config, file
browser, TTS/STT, and the opencode event stream transport.
@thrawn-sh
thrawn-sh force-pushed the fix/missing-fetch-credentials branch from d0f5b0c to e207c83 Compare July 28, 2026 19:25
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4a3b8585-be8e-4656-9222-fc503b6a4840

📥 Commits

Reviewing files that changed from the base of the PR and between 29f154a and e207c83.

📒 Files selected for processing (8)
  • frontend/src/api/stt.test.ts
  • frontend/src/api/stt.ts
  • frontend/src/components/file-browser/FileBrowser.tsx
  • frontend/src/components/file-browser/FilePreview.tsx
  • frontend/src/contexts/AuthContext.tsx
  • frontend/src/contexts/TTSContext.tsx
  • frontend/src/lib/auth-loaders.ts
  • frontend/src/lib/opencode-event-stream/browserTransport.ts

📝 Walkthrough

Walkthrough

Frontend fetch requests now explicitly set credentials: 'include' for authentication configuration, speech, event-stream, file browsing, file preview, and file mutations. The STT request test now verifies the credential option.

Changes

Credential inclusion

Layer / File(s) Summary
Authentication configuration requests
frontend/src/contexts/AuthContext.tsx, frontend/src/lib/auth-loaders.ts
Authentication configuration requests now include browser credentials.
Authenticated application requests
frontend/src/api/stt.ts, frontend/src/api/stt.test.ts, frontend/src/contexts/TTSContext.tsx, frontend/src/lib/opencode-event-stream/browserTransport.ts, frontend/src/components/file-browser/*
Speech, event-stream, file browsing, file preview, upload, and file mutation requests now include credentials; the STT test verifies the updated request shape.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: chriswritescode-dev

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding credentials to frontend auth-related fetches.
Description check ✅ Passed The description includes the required Summary, Type of Change, and Checklist sections with mostly complete details.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant